package com.leoman.user.dao;

import com.leoman.common.dao.IBaseJpaRepository;
import com.leoman.user.entity.UserInvited;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by Administrator on 2016/6/12.
 */
public interface UserInvitedDao extends IBaseJpaRepository<UserInvited> {

    @Query("select a from UserInvited a where a.user.id = ?1")
    public UserInvited findOneByUserId(Long userId);

    @Query("select a from UserInvited a where a.user.id in (select b.id from UserInfo b)")
    public List<UserInvited> findValidList();
}
